<script>
$(document).ready(function(){
	{params}
	
	var c={
		init:function(){
			this.loaddata();
		},
		closed:function(){
			reim.closenowtabs();
		},
		loaddata:function(){
			reim.ajax('company,getjoin',{},function(ret){
				c.showdata(ret.data);
			});
		},
		showdata:function(da){
			this.data = da;
			var i,len=da.length,str='';
			for(i=0;i<len;i++){
				str+='<div onclick="" class="kuailist"><img src="'+da[i].logo+'" align="absmiddle" name="face" style="height:24px;width:24px">&nbsp;'+da[i].name+'';
				if(da[i].status==0){
					str+=' <button type="button" click="guanzhu,'+i+'" style="background:#66CCFF" class="webbtn webbtn-mini">去关注</button>';
				}else{
					if(da[i].num==cnum){
						str+=' <font color="green"><i class="icon-ok"></i></font>';
					}else{
						str+=' <button type="button" click="qiehuan,'+i+'" class="webbtn webbtn-mini">切换</button>';
					}
				}
				str+='</div>';
			}
			$('#guanview{rand}').append(str);
			js.initbtn(c);
		},
		qiehuan:function(o1,i1){
			var d = this.data[i1];
			js.confirm(lang('qielons',d.name),function(jg){
				if(jg=='yes'){
					js.loading(lang('qielong'));
					reim.ajax('company,change',{qieid:d.id},function(){
						js.location('?d=reim&cnum='+d.num+'');
					});
				}
			});
		},
		guanzhu:function(oi,i1){
			var d = this.data[i1];
			
			js.prompt('请输入手机号来验证关注',function(jg,txt){
				if(jg=='yes'){
					js.loading('验证中...');
					reim.ajax('company,joinactive',{aid:d.aid,mobile:txt},function(ret){
						js.msgok('验证成功');
						js.reload();
					},false,function(ret){
						js.msgerror(ret.msg);
					});
				}
			},'验证关注');
		}
	}
	
	c.init();
});
</script>


<div style="line-height:30px;margin-left:55px;margin-top:30px"><b>单位切换：</b>&nbsp;<a click="closed" style="color:gray">关闭</a></div>
<div style="margin:50px;margin-top:0px; background:white;border-radius:5px">
<div class="blank10"></div>


<div id="guanview{rand}" ></div>
	
<div class="blank10"></div>	
</div>
